package com.springbootblog.controller.fontend;

import com.springbootblog.service.fontend.ToolsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 工具部分接口
 * @className AboutController
 * @author camellia
 * @email 805795955@qq.com
 * @date 2024/01/01
 * @version 1.0
 */
@RequestMapping("java")
@RestController
//@CrossOrigin(origins="*",maxAge=3600)
public class ToolsController
{
    /**
     * 自动装载（service接口注入）
     */
    @Autowired
    private ToolsService toolsService;

    @GetMapping("tools/getData")
    public Map<String,Object> getToolsList(@RequestParam(defaultValue = "0") String category_id)
    {
        if(category_id == null || category_id.equals(""))
        {
            category_id = "0";
        }
        // System.out.println("category_id:"+category_id);
        Map<String,Object> result = toolsService.getToolsList(category_id);
        return result;
    }
}
